

#include <iostream>
using namespace std;

//void swap(int& a, int& b)
//{
//	int tmp = a;
//	a = b;
//	b = tmp;
//}
//
//void swap(double& a, double& b)
//{
//	double tmp = a;
//	a = b;
//	b = tmp;
//}
//
//int main()
//{
//	int a = 1, b = 2;
//	double c = 1.1, d = 2.2;
//
//	cout << "a = " << a << "  " << "b = " << b << endl;
//	swap(a, b);
//	cout << "a = " << a << "  " << "b = " << b << endl;
//
//	cout << "c = " << c << " " << "d = " << d << endl;
//	swap(c, d);
//	cout << "c = " << c << " " << "d = " << d << endl;
//
//
//
//	return 0;
//}

////template <class T>
//template <typename T>
//void Swap(T& a, T& b)
//{
//	T tmp = a;
//	a = b;
//	b = tmp;
//}
//
//int main()
//{
//	int a = 1, b = 2;
//	double c = 1.1, d = 2.2;
//	
//	cout << "a = " << a << "  " << "b = " << b << endl;
//	Swap(a, b);
//	cout << "a = " << a << "  " << "b = " << b << endl;
//	
//	cout << "c = " << c << " " << "d = " << d << endl;
//	Swap(c, d);
//	cout << "c = " << c << " " << "d = " << d << endl;
//
//	return 0;
//}

template<class T>
T add(const T& a,const T& b)
{
	return a+b;
}

int main()
{
	int a = 1, b = 2;
	double c = 1.1, d = 2.2;

	cout << a << "+" << b << "= "  << add(a, b) << endl;
	cout << c << "+" << d << "= " << add(c, d) << endl;
	cout << a << "+" << c << "= " << add(a, (int)c) << endl;
	cout << a << "+" << c << "= " << add((double)a, c) << endl;
	cout << a << "+" << c << "= " << add<int>(a, c) << endl;
	cout << a << "+" << c << "= " << add<double>(a, c) << endl;


	return 0;
}